$(document).ready(function() {

		$.ajax({
			url: "/show",
			success: function(data) {
				var result = data;
				for(var i = 0; i < result.length; i++) {
	
					$("#comment").append("<span style='color: blue; font - size: 16 px;'>" + result[i].user.username + ":&nbsp;&nbsp;&nbsp;&nbsp;</span>" + result[i].pllr + "<br />");
	
				}
			}
	
		});
	
		
	//图片的显示和加载
	$.ajax({
		url: "/showMenuPictures",
		success: function(data) {
			var result = data;
			for(var i = 0; i < result.length; i++) {
				var url = result[i].link;
				$("#pic_" + i).attr("src", url);
				
			}

		}
		

	});

})


$("#commit").click(function() {
	


	var text = $("#memo").val();

	var message = {
		"pllr": text
	};
	var jsonData = JSON.stringify(message);

	$.ajax({
		type: "post",
		url: "/commit",
		data: jsonData,
		dataType: "json",
		contentType: "application/json;charset=UTF-8",
		success: function(data) {

		}
	});

	$("#memo").val("");
	$("#fabu").hide(500);
	

});

